﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.Model.Models
{   
    /// <summary>
    /// 每日存库快照
    /// </summary>
    [Table("t_InventoryDay")]
    public class InventoryDay:BaseEntity
    {
        /// <summary>
        /// 库房Id
        /// </summary>
        public long? WarehouseId { get; set; }
        /// <summary>
        /// 库房编码
        /// </summary>
        [MaxLength(50)]
        public string WarehouseCode { get; set; }
        /// <summary>
        /// 库房名称
        /// </summary>
        [MaxLength(20)]
        public string WarehouseName { get; set; }
        /// <summary>
        /// 库区Id
        /// </summary>
        public long? AreaId { get; set; }
        /// <summary>
        /// 库区编码
        /// </summary>
        [MaxLength(50)]
        public string AreaCode { get; set; }
        /// <summary>
        /// 库区名称
        /// </summary>
        [MaxLength(20)]
        public string AreaName { get; set; }
        /// <summary>
        /// 仓位Id
        /// </summary>
        public long? LocationId { get; set; }
        /// <summary>
        /// 仓位编码
        /// </summary>
        [MaxLength(50)]
        public string LocationCode { get; set; }
        /// <summary>
        /// 垛所在仓位深度
        /// </summary>
        public int LocationDepth { get; set; }
        /// <summary>
        /// 排号
        /// </summary>
        public int LocationLineNo { get; set; }
        /// <summary>
        /// 层号
        /// </summary>
        public int LocationLayerNo { get; set; }
        /// <summary>
        /// 列号
        /// </summary>
        public int LocationColumnNo { get; set; }
        /// <summary>
        /// 货位名称
        /// </summary>
        [MaxLength(20)]
        public string LocationName { get; set; }
        public int? LocationHeightType { get; set; }
        /// <summary>
        /// 库存状态：1-正常库存；2-转移中的库存；3-入库在途；4-出库在途；5-限制使用的库存;6-异常库存;7-预分配库存;8-冻结库存
        /// </summary>
        public int? Status { get; set; }
        /// <summary>
        /// 垛条码
        /// </summary>
        [MaxLength(20)]
        public string PalletBarcode { get; set; }
        /// <summary>
        /// 关联详情单Id
        /// </summary>
        public long? RelatedOrderDetailId { get; set; }
        /// <summary>
        /// 单据类型Id
        /// </summary>
        public int? BillType { get; set; }
        /// <summary>
        /// 是否锁定：false-未锁定；true-锁定
        /// </summary>
        public bool? IsLock { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(50)]
        public string Remark { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public long? MaterialId { get; set; }
        /// <summary>
        /// 物料号
        /// </summary>
        [MaxLength(50)]
        public string MaterialCode { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        [MaxLength(50)]
        public string MaterialName { get; set; }

        /// <summary>
        /// 物料条码（69码）
        /// </summary>
        [MaxLength(50)]
        public string Articlebarcode { get; set; }

        /// <summary>
        /// 是否有货号详情
        /// </summary>
        public bool HasSkuDetail { get; set; }
        /// <summary>
        /// 可用库存数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? AvailableQty { get; set; }
        /// <summary>
        /// 已分配数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? AllocateQty { get; set; }
        /// <summary>
        /// 上架数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? PutawayQty { get; set; }
        /// <summary>
        /// 下架数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? PickedQty { get; set; }
        /// <summary>
        /// 基本单位Id
        /// </summary>
        public long? UnitId { get; set; }
        /// <summary>
        /// 基本单位
        /// </summary>
        public string UnitName { get; set; }
        /// <summary>
        /// 包装数量
        /// </summary>
        public int? PackQty { get; set; }
        /// <summary>
        /// 物料批次信息Id
        /// </summary>
        public long? MaterialKeyId { get; set; }
        /// <summary>
        /// 入库时间
        /// </summary>
        public DateTime? InStockDate { get; set; }

        /// <summary>
        /// 质量状态：0-待检；1-合格；2-不合格；
        /// </summary>
        public int? QualityState { get; set; }
        /// <summary>
        /// 批次号
        /// </summary>
        public string BatchNo { get; set; }

        /// <summary>
        /// 有效时间
        /// </summary>
        public DateTime? ExpireDate { get; set; }
        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime? ProductDate { get; set; }
        /// <summary>
        /// 供应商Id
        /// </summary>
        public long? SupplierId { get; set; }
        /// <summary>
        /// 供应商
        /// </summary>
        [MaxLength(20)]
        public string SupplierName { get; set; }

        /// <summary>
        /// 客户id
        /// </summary>
        public long? CustomerId { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        [MaxLength(20)]
        public string CustomerName { get; set; }

        /// <summary>
        /// 物料类型Id
        /// </summary>
        public long? MaterialTypeId { get; set; }
        [MaxLength(50)]
        public string MaterialTypeCode { get; set; }
        /// <summary>
        /// 物料类型
        /// </summary>
        [MaxLength(20)]
        public string MaterialTypeName { get; set; }
        public string ProduceFactory { get; set; }
        public DateTime? OutFactoryDate { get; set; }
        public DateTime? Qadate { get; set; }
        /// <summary>
        /// ERP货位编码
        /// </summary>
        public string ErplocationCode { get; set; }
        /// <summary>
        /// 巷道id
        /// </summary>
        public long? RoutewayId { get; set; }
        /// <summary>
        /// 组垛id
        /// </summary>
        public long? StackingStorageId { get; set; }
        /// <summary>
        /// 部门编码
        /// </summary>
        public string DeptCode { get; set; }
        /// <summary>
        /// 部门名称
        /// </summary>
        public string DeptName { get; set; }


        /// <summary>
        /// 当前业务类型
        /// </summary>
        public int BusinessType { get; set; }
        [Column(TypeName = "decimal(18,2)")]
        public decimal? LocationDistanceValue { get; set; }
        public string LogicalPartCode { get; set; }
        /// <summary>
        /// 垛实际高度类型
        /// </summary>
        public int? RealHeightType { get; set; }
        /// <summary>
        /// 发货单号
        /// </summary>
        public string DisOrderNo { get; set; }
        /// <summary>
        /// 发货单行号
        /// </summary>
        public string DisOrderLineNo { get; set; }
        public int? InStockShortDate { get; set; }
        public string WoodPalletBarcode { get; set; }
        public string PurOrderNo { get; set; }
        public string PurOrderLineNo { get; set; }
        /// <summary>
        /// 判断是否允许拣选出库
        /// </summary>
        public int? PurOrderLineType { get; set; }
        public bool? IsMultPallet { get; set; }
        public int? MultPalletId { get; set; }
        /// <summary>
        /// 总价
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? TotalPrice { get; set; }
        public int? MaterialCategoryId { get; set; }
        public string MaterialCategoryName { get; set; }
        /// <summary>
        /// 批次说明
        /// </summary>
        public string BatchNoExplain { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? Price { get; set; }
        public string ParentPalletBarcode { get; set; }

        /// <summary>
        /// 出库数量
        /// </summary>
        [NotMapped]
        public decimal? OutQty { get; set; }

        /// <summary>
        /// 库存预警
        /// </summary>
        public int InventoryAlert { get; set; }

        /// <summary>
        /// 产品状态 默认合格
        /// </summary>
        public string WhetherQualified { get; set; }

        [NotMapped]
        public List<InventoryDetail> InventoryDetail { get; set; }
    }
}
